#ifndef SDPMODULE_H
#define SDPMODULE_H

#include "SdpData.h"

#include <string>

#include "resip/stack/SdpContents.hxx"

class ConferenceModule;

class SdpModule
{
public:
	// Constructor & Destructor

	SdpModule();
	virtual ~SdpModule();

	// Memberfunctions

	void initialize();
	void cleanup();

	void readCodecFile(std::string file);

	std::string createSdpOffer();
	bool acceptSdpOffer(const resip::SdpContents &sdpContents);

	// Updatefunctions

	void setVersion(short version){ m_sdpData.version = version; }

	void setUsername(std::string username){ m_sdpData.username = username; }
	void setSessionId(std::string sessionId){ m_sdpData.sessionId = sessionId; }
	void setSessionVersion(std::string sessionVersion){ m_sdpData.sessionVersion = sessionVersion; }
	void setBaseIP(std::string baseIP){ m_sdpData.baseIP = baseIP; }

	void setSessionName(std::string sessionName){ m_sdpData.sessionName = sessionName; }

	void setStartTime(long startTime){ m_sdpData.startTime = startTime; }
	void setStopTime(long stopTime){ m_sdpData.stopTime = stopTime; }

	void setMediaIP(std::string mediaIP){ m_sdpData.mediaIP = mediaIP; }

	void setAudioPort(long audioPort){ m_sdpData.audioPort = audioPort; }
	void setVideoPort(long videoPort){ m_sdpData.videoPort = videoPort; }

private:
	// Membervariables

	SdpData m_sdpData;
	SdpData m_otherSdpData;
	void parseSdpLine(char * sdpLine);
	std::vector<std::string> codecPars; // tijdelijk opslagen van codec parameters, moeten apart geparsed worden

	// conference server for media streaming by RTP

	void initializeConference();

	ConferenceModule * m_sendModule;
	ConferenceModule * m_receiveModule;


};

#endif